#ifndef MINECLEAN_H
#define MINECLEAN_H

#include <QMainWindow>
#include <QDebug>
#include <QPainter>
#include <QPixmap>
#include <QMouseEvent>
#include <QTimer>
#include <QMessageBox>
#include <qmessagebox.h>
#include <block.h>
#include <dialog.h>

//定义常量
#define BLOCK_LENGTH 21//格子图片大小21×21像素
#define BLOCK_HEIGHT 21
#define ELENUM_LENGTH 20
#define EXPRESSION_LENGTH 24
#define EXPRESSION_HEIGHT 24
#define TTILE_BEGIN 0
#define TITILE_HEIGHT  (TTILE_BEGIN+40)
#define PRIMARY_LENGTH  189 //21*9
#define MIDDLE_LENGTH   336 //21*16
#define TOP_LENGTH      630 //21*30

namespace Ui {
class mineclean;
}

class mineclean : public QMainWindow
{
    Q_OBJECT

public:
    explicit mineclean(QWidget *parent = 0);
    ~mineclean();
private:
    Ui::mineclean *ui;
    QTimer * runtime;
    Dialog * useDefineWindows;
protected:
    virtual void paintEvent(QPaintEvent *event);
    virtual void mousePressEvent(QMouseEvent *event);
private slots:
    void on_actionPrimary_triggered();
    void on_actionMiddle_triggered();
    void on_actionSenior_triggered();
    void on_actionQuit_2_triggered();
    void on_actionUser_defined_triggered();
    void on_actionRandom_triggered();
    void on_actionRestart_triggered();
};

void showblock(int x,int y);
int iswin();
void paintboom(QPainter * painter);
void createinterface();

#endif // MINECLEAN_H
